<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@include file="../common/common.jsp"%>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/regist_login.js"></script>
<title>Hami鲜花--欢迎登录</title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/login.css">
</head>
<body>
	<%@include file="frame/top.jsp" %>
	<div class="container">
		<div class="main_div">
		<form class="form-horizontal form-signin" role="form" action="<%=request.getContextPath() %>/doLogin.action" method="post" onsubmit="return checkLoginForm()">
			<div class="from-group">
				<%
					String errorMsg = (String)request.getAttribute("errorMsg");
					if(errorMsg != null && !errorMsg.equals("")) {
				%>
				<p id="errorMsg" style="color: red;"><%=errorMsg %></p>
				<%
					}
				%>
			</div>
			<div class="col-md-3"></div>
			<div class="col-md-9">
				<h2 class="form-signin-heading">欢迎登录</h2>
			</div>
			<div class="form-group">
				<label for="loginName" class="col-md-3 control-label">账号</label>
				<div class="col-md-9">
					<input id="loginName" name="loginName" type="text" class="form-control" placeholder="电子邮箱或手机号" required autofocus> 
					<span id="nameSuccessTip" class="label label-success" style="display: none;">有效</span> 
					<span id="nameErrorTip" class="label label-warning" style="display: none;">请输入合法邮箱或手机号</span>
				</div>
			</div>
			<div class="form-group">
				<label for="loginPassword" class="col-md-3 control-label">密码</label>
				<div class="col-md-9">
					<input id="loginPassword" name="loginPassword" type="password" class="form-control" placeholder="登录密码" required> 
					<span id="passwordSuccessTip" class="label label-success" style="display: none;">有效</span> 
					<span id="passwordErrorTip" class="label label-warning" style="display: none;">请输入合规密码</span>
				</div>
			</div>
			<div class="form-group">
				<div class="col-md-3"></div>
				<div class="col-md-9">
					<button class="btn btn-lg btn-primary btn-block" type="submit">登&nbsp;&nbsp;录</button>
				</div>
			</div>
		</form>
		</div>
	</div>
	<%@include file="frame/feet.jsp" %>
</body>
<script type="text/javascript">

	$(function() {
		$('#loginName').blur(function() {
			checkLoginName('loginName');
		});
		$('#loginPassword').blur(function() {
			checkPassword('loginPassword');
		});
	});

	function checkLoginForm() {
		if(!checkLoginName('loginName')) {
			return false;
		}else if(!checkPassword('loginPassword')) {
			return false;
		}
		return true;
	}
</script>
</html>